package gui.interfaces;

import javax.swing.text.BadLocationException;

import model.data.FileDescription;

/**
 * <b>Project ChatSystemG6 INSA 4INFOA1 - 2013/2014</b>
 * <P>
 * <i>Package gui </i> <br>
 * Interface ToUser describes all the signals received by the local user by the
 * chatSystem<br>
 * 
 * @author Christelle SIAGO HAPPI
 */
public interface ToUser {

	/**
	 * called when a text message is received
	 * 
	 * @param remote
	 * @param text
	 * @throws BadLocationException 
	 */
	public void receivedMessage(String remote, String text) throws BadLocationException;

	/**
	 * hide the welcome page when the user is connected and display it when he
	 * is disconnected
	 * 
	 * @param isDisplay
	 *            is false when the local user is diconnected
	 */

	public void displayWelcomePage(boolean isDisplay);

	/**
	 * called when the remote user gave his response to the file request sending
	 * 
	 * @param sFilename
	 *            : the file to send
	 * @param rUser
	 *            : the remote user
	 * @return
	 */

	public boolean responseToFileRequest(FileDescription sFilename, String rUser);

	/**
	 * refresh the file transfert state
	 * 
	 * @param isAccept
	 *            is true the remote user accept the file request and false
	 *            otherwise
	 */

	public void refreshFileTransferSate(boolean isAccept);

	/**
	 * Wizz the chat gui of the remote user
	 * 
	 * @param remoteUsername
	 *            username of the remote user
	 */
	public void receiveWizz(String remoteUsername);

	/**
	 * notification about the status of a user
	 * 
	 * @param remoteUsername
	 *            username of the remote user
	 * @param status
	 *            Status of the local user
	 */
	void receivedStatus(String remoteUsername, String status);

	/**
	 * called when the user is writing
	 * 
	 * @param remoteUsername
	 *            username of the remote user
	 * @param isWriting
	 *            <code>true</code> if the local user is writing
	 *            <code>false</code> otherwise
	 * @throws BadLocationException 
	 */
	public void receivedUserNotification(String remoteUsername, boolean isWriting) throws BadLocationException;

	

}
